using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using WCSFContrib.Extensions.CompositeWeb.Configuration;
using Microsoft.Practices.CompositeWeb.Interfaces;

namespace WCSFContrib.Extensions.CompositeWeb.Tests.Configuration
{
    /// <summary>
    /// Summary description for CustomDependantModuleInfoFixture
    /// </summary>
    [TestClass]
    public class CustomDependantModuleInfoFixture
    {
        [TestMethod]
        public void InitializesCorrectly()
        {
            CustomDependantModuleInfo mInfo = new CustomDependantModuleInfo("name", "type", "location");

            Assert.AreEqual("name", mInfo.Name);
            Assert.AreEqual("type", mInfo.AssemblyName);
            Assert.AreEqual("location", mInfo.VirtualPath);
            Assert.IsNull(mInfo.Services);
        }

        [TestMethod]
        public void TestCustomDependantModuleInfoIsIModuleInfo()
        {
            CustomDependantModuleInfo info = new CustomDependantModuleInfo("name", "type", "location");

            Assert.IsTrue(info is IModuleInfo);
        }

        [TestMethod]
        public void TestServiceInfoLenght()
        {
            CustomDependantModuleInfo info = new CustomDependantModuleInfo("name", "type", "location");
            info.Services = new ServiceInfo[] { new ServiceInfo() };

            Assert.IsNotNull(info.Services);
            Assert.AreEqual(1, info.Services.Length);
        }
    }
}
